<template>
  <div class="screen-data-maintain-container">
    <el-form :model="requestParams"
             label-width="140px"
             :rules="rules"
             ref="requestParams">
      <div class="condition-style">
        <h2 class="title">{{ $route.query.project_name }}</h2>
      </div>
      <el-col :span="24"
              class="padding-style">
        <p class="pro-progress">项目进度</p>
        <el-col :span="12">
          <el-form-item label="进度部位"
                        prop="project_stage">
            <el-select v-model="requestParams.project_stage"
                       clearable
                       :disabled="isDisabled()"
                       class="sel-style"
                       @change="progressPositionChange"
                       placeholder="请选择">
              <el-option v-for="item in  dropDownData()"
                         :key="item.value"
                         :label="item.name"
                         :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="承包类型"
                        prop="contract_type">
            <el-select v-model="requestParams.contract_type"
                       clearable
                       class="sel-style"
                       placeholder="请选择">
              <el-option v-for="item in contractTypeArr"
                         :key="item.value"
                         :label="item.name"
                         :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="验收报告"
                        v-if="isShowTestReport()">
            <el-upload class="company-logo-upload"
                       ref="uploadFile"
                       :http-request="uploadFile"
                       action
                       :show-file-list="false"
                       :limit="5-filesList.length"
                       accept=".pdf,.doc,.docx"
                       :multiple="true"
                       :disabled='filesList.length===5'
                       :auto-upload="false"
                       :file-list="fileList"
                       :on-success="handleFileSuccess"
                       :on-change="handleFileChange"
                       :on-exceed="handleFileExceed"
                       :before-upload="beforeFileUpload">
              <!-- icon="el-icon-top" -->
              <el-button class="upload"
                         size="small"
                         :disabled='filesList.length===5'
                         :type="filesList.length===5?'info':'primary'">上传</el-button>
              <div slot="tip"
                   class="el-upload__tip tip-height">
                只能上传PDF、WORD文件，且不超过50M,文件个数限制为5个
              </div>
            </el-upload>

            <div class="accept-position">
              <ul>
                <li v-for="(item, ind) in filesList">
                  <p :title='item.fileName'>{{ item.fileName }}</p>
                  <p>
                    <el-button type="danger"
                               size="mini"
                               @click="deleteCurrentRow(item, ind)">删除</el-button><el-button type="primary"
                               size="mini"
                               @click='lookAndDown(item)'>查看及下载</el-button>
                  </p>
                </li>
              </ul>
            </div>
          </el-form-item>
        </el-col>
      </el-col>
      <el-col :span="24"
              class="padding-style">
        <p class="pro-zhgd-situation">项目智慧工地未接入原因</p>
        <!-- <el-col :span="12">
            <el-form-item label='接入原因' prop="not_butt_reason">
              <div class="reason-style">
                <el-select v-model="requestParams.not_butt_reason" clearable class="sel-style" placeholder="请选择">
                  <el-option v-for="item in notButtReasonArr" :key="item.value" :label="item.name" :value="item.value">
                  </el-option>
                </el-select>
                <el-input class="input-style" placeholder="请输入详细原因"
                  v-model="requestParams.not_butt_reason_detail"></el-input>
              </div>
            </el-form-item>
            <el-form-item label='劳务实名制供应商' prop="labor_supplier">
              <el-input placeholder="请输入" class="input-style" v-model="requestParams.labor_supplier"></el-input>
            </el-form-item>
            <el-form-item label='扬尘监控供应商' prop="dust_supplier">
              <el-input placeholder="请输入" class="input-style" v-model="requestParams.dust_supplier"></el-input>
            </el-form-item>
            <el-form-item label='塔机黑匣子供应商' prop="tower_supplier">
              <el-input placeholder="请输入" class="input-style" v-model="requestParams.tower_supplier"></el-input>
            </el-form-item>
            <el-form-item label='视频监控供应商' prop="video_supplier">
              <el-input placeholder="请输入" class="input-style" v-model="requestParams.video_supplier"></el-input>
            </el-form-item>
          </el-col> -->
        <el-table :data="notConnectedReasonList"
                  border
                  style="width: 100%">
          <el-table-column type="index"
                           label="序号"
                           width="80"
                           align="center">
          </el-table-column>
          <el-table-column prop="supplierType"
                           label="供应商类型"
                           width="180"
                           align="center">
          </el-table-column>
          <el-table-column prop="supplier_code"
                           label="供应商名称"
                           width="240"
                           align="center">
            <template slot-scope="scope">
              <div>
                <el-select v-model="scope.row.supplier_code"
                           clearable
                           class="table-sel-style"
                           filterable
                           placeholder="请选择"
                           @change="
                    getAccessStat(scope.row.supplier_type_code, scope.$index)
                  ">
                  <el-option v-for="item in suppliers"
                             :key="item.value"
                             :label="item.name"
                             :value="item.value">
                  </el-option>
                </el-select>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="not_butt_reason"
                           label="未接入原因"
                           width="340"
                           align="center">
            <template slot-scope="scope">
              <div>
                <!-- <span v-if="scope.row.is_butt_status==='1'">已对接</span> -->
                <el-select v-model="areadyInterface"
                           clearable
                           v-if="scope.row.is_butt_status==='1'"
                           :disabled="true"
                           class="table-sel-style"
                           placeholder="请选择">
                  <el-option v-for="item in notButtReasonArr"
                             :key="item.value"
                             :label="item.name"
                             :value="item.value">
                  </el-option>
                </el-select>
                <el-select v-model="scope.row.not_butt_reason"
                           clearable
                           v-else
                           class="table-sel-style"
                           placeholder="请选择">
                  <el-option v-for="item in notButtReasonArr"
                             :key="item.value"
                             :label="item.name"
                             :value="item.value">
                  </el-option>
                </el-select>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="not_butt_reason_detail"
                           label="具体原因"
                           align="center">
            <template slot-scope="scope">
              <div>
                <el-input v-model="scope.row.not_butt_reason_detail"
                          :disabled="scope.row.not_butt_reason === ''"
                          placeholder=""></el-input>
              </div>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="signAgreement" label="是否已签协议" align="center" width="140">
            <template slot-scope="scope">
              <div>
                <el-switch style="display: block" v-model="scope.row.signAgreement" active-color="#13ce66">
                </el-switch>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="isPay" label="是否已付款" align="center" width="140">
            <template slot-scope="scope">
              <div>
                <el-switch style="display: block" v-model="scope.row.isPay" active-color="#13ce66">
                </el-switch>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="payment_amount" label="付款额" align="center" width="140">
            <template slot-scope="scope">
              <div>
                <el-input v-model="scope.row.payment_amount" placeholder="" :disabled="!scope.row.isPay"
                  type="number"></el-input>
              </div>
            </template>
          </el-table-column> -->
        </el-table>
      </el-col>
      <el-col :span="24"
              class="bottom-style">
        <el-button @click="onCancel"
                   style="color:black;">取消</el-button>
        <el-button type="primary"
                   @click="onSure('requestParams')">确定</el-button>
      </el-col>
    </el-form>

    <el-dialog :title="'正在上传(' + uploadFileIndex + '/' + uploadQuene.length + ')'"
               width="768px"
               @close="uploadDialogClose"
               :visible.sync="uploadQueneDialogVisible">
      <ul class="upload-quene-list">
        <li class="upload-quene-item"
            v-for="(item, index) in uploadQuene"
            :key="index">
          <span class="file-name">
            <img src="@/assets/file-icon.png"
                 alt="" />
            <i>{{ item.name }}</i>
          </span>
          <span class="file-size">{{ item.file_size }}</span>
          <span v-if="item.status !== 'resolve'"
                class="staus">{{
            item.percent
          }}</span>
          <span class="status"
                v-if="item.status === 'resolve'">
            <i class="fa fa-check-circle"></i>
          </span>
        </li>
      </ul>
      <div slot="footer"
           class="dialog-footer">
        <el-button @click="closeDialog"
                   type="primary">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import OSS from "ali-oss";
import moment from "moment"; //时间处理库
import { standardCodeApi } from "@/services/StandardCode";
import { ZHGDConsSitApi } from "@/services/ProjectCenter";
export default {
  data () {
    return {
      areadyInterface: '已对接',
      // 上传文件进度弹框是否可见
      uploadQueneDialogVisible: false,
      timerId: 0,
      fileList: [],
      filesList: [],
      // 等待上传文件列表
      uploadQuene: [],
      // 当前上传文件在列表中的index
      uploadFileIndex: 0,
      selNotButtReasonArr: [], //选中的接入原因
      ProjecPhaseArr: [], //进度部位
      ProjecPhaseFilterArr: [], //进度部位（未过滤掉'竣工验收'）
      contractTypeArr: [], //承包类型
      notButtReasonArr: [], //接入原因
      suppliers: [], //供应商
      requestParams: {
        project_id: "",
        project_stage: "",
        contract_type: "",
        not_butt_reason: "",
        not_butt_reason_detail: "",
        labor_supplier: "",
        dust_supplier: "",
        tower_supplier: "",
        video_supplier: ""
      },
      // 未接入原因表格数据
      notConnectedReasonList: [
        {
          supplier_type_code: 1,
          supplierType: "实名制厂商",
          supplier_code: "",
          not_butt_reason: "",
          not_butt_reason_detail: "",
          access_stat: 0,
          signAgreement: false,
          isPay: false,
          payment_amount: ""
        },
        {
          supplier_type_code: 2,
          supplierType: "塔机黑匣子",
          supplier_code: "",
          not_butt_reason: "",
          not_butt_reason_detail: "",
          access_stat: 0,
          signAgreement: false,
          isPay: false,
          payment_amount: ""
        },
        {
          supplier_type_code: 3,
          supplierType: "视频监控",
          supplier_code: "",
          not_butt_reason: "",
          not_butt_reason_detail: "",
          access_stat: 0,
          signAgreement: false,
          isPay: false,
          payment_amount: ""
        },
        {
          supplier_type_code: 4,
          supplierType: "扬尘设备",
          supplier_code: "",
          not_butt_reason: "",
          not_butt_reason_detail: "",
          access_stat: 0,
          signAgreement: false,
          isPay: false,
          payment_amount: ""
        }
      ],
      rules: {
        project_stage: [
          {
            required: true,
            message: "进度部位不能为空",
            trigger: ["change", "blur"]
          }
        ],
        contract_type: [
          {
            required: true,
            message: "承包类型不能为空",
            trigger: ["change", "blur"]
          }
        ],
        not_butt_reason: [
          {
            required: true,
            message: "接入原因不能为空",
            trigger: ["change", "blur"]
          }
        ],
        labor_supplier: [
          {
            required: true,
            message: "劳务实名制供应商不能为空",
            trigger: ["change", "blur"]
          }
        ],
        dust_supplier: [
          {
            required: true,
            message: "扬尘监控供应商不能为空",
            trigger: ["change", "blur"]
          }
        ],
        tower_supplier: [
          {
            required: true,
            message: "塔机黑匣子供应商不能为空",
            trigger: ["change", "blur"]
          }
        ],
        video_supplier: [
          {
            required: true,
            message: "视频监控供应商不能为空",
            trigger: ["change", "blur"]
          }
        ]
      }
    };
  },
  methods: {
    dropDownData () { // 进度部位下拉数据
      let arr = [];
      let projectStage = this.requestParams.project_stage;
      if (this.filesList.length > 0) {
        arr = this.ProjecPhaseArr;
        projectStage = '6';
      } else {
        if (projectStage === '5' || projectStage === '6') {
          projectStage = '5'
        }
        arr = this.ProjecPhaseFilterArr;
      };
      this.requestParams.project_stage = projectStage;
      return arr;
    },
    isDisabled () { // 进度部位是否禁用
      let disabledValue = false;
      let projectStage = this.requestParams.project_stage;
      if (this.filesList.length > 0 && projectStage === '6') {
        disabledValue = true;
      }
      return disabledValue;
    },
    getCurrentDocType (fileAddrPath) {//当前文件类型
      let result = fileAddrPath.substring(fileAddrPath.length - 3);
      return result
    },
    async lookAndDown (item) {
      if (await this.getCurrentDocType(item.fileAddress) === 'pdf') {
        window.open(item.fileAddress, '_blank');
      } else {
        window.open('https://view.officeapps.live.com/op/view.aspx?src=' + item.fileAddress, '_blank');
      }
    },
    async deleteAcceptposition (attachmentId) { // 删除
      const data = await ZHGDConsSitApi.deleteFile({
        data: {
          associationId: this.$route.query.project_id,
          attachmentIds: [attachmentId]
        }
      });
      let code = data.code;
      if (code === 0) {
        this.queryFiles()
        this.$message.success('操作成功')
      }
    },
    deleteCurrentRow (item, ind) {
      this.$confirm(`确定要删除"${item.fileName}"？`, {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(async () => {
          await this.deleteAcceptposition(item.attachmentId);
          this.$message.success("删除成功");
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    progressPositionChange (value) {
      // this.filesList = [];
    },
    // 关闭上传文件弹框,清空队列,调用文件列表新增接口
    async closeDialog () {
      await this.createAcceptposition()
      this.$refs.uploadFile.clearFiles();
      this.uploadQueneDialogVisible = false;
    },
    async createAcceptposition () { // 新增部位
      const data = await ZHGDConsSitApi.uploadFiles({
        data: {
          associationId: this.$route.query.project_id,
          files: this.getFiles(this.uploadQuene)
        }
      });
      let code = data.code;
      if (code === 0) {
        this.queryFiles()
        this.$message.success('操作成功')
      }
    },
    async queryFiles () { // 查询部位
      const data = await ZHGDConsSitApi.queryFiles({
        params: {
          projectId: this.$route.query.project_id
        }
      });
      let code = data.code;
      if (code === 0) {
        this.filesList = data.data;
      }
    },
    getFiles (arr) {
      let list = [];
      if (arr.length > 0) {
        arr.forEach(ele => {
          list.push({
            fileAddress: ele.fileAddress,
            fileName: ele.fileName
          })
        })
      }
      return list;
    },
    // 点击右上角的×关闭时，只清空队列，不调用新增
    uploadDialogClose () {
      this.uploadQuene = [];
      this.$refs.uploadFile.clearFiles();
      this.uploadQueneDialogVisible = false;
    },
    // 上传文件
    uploadFile (file) {
      var client = new OSS({
        region: "oss-cn-hangzhou",
        accessKeyId: this.util.decrypt(process.env.AES_OSS_ID),
        accessKeySecret: this.util.decrypt(process.env.AES_OSS_SECRET),
        bucket: process.env.bucket
      });
      let address =
        "smartConstructSiteInvestmentSituation/acceptanceReport/" +
        moment().format("YYYY-MM-DD HH:mm:ss") +
        file.file.name;
      client
        .multipartUpload(address, file.file, {
          progress: percent => {
            // this.$set(this.uploadQuene[this.uploadFileIndex], 'percent', parseInt(percent * 100) + '%')
            this.uploadQuene[this.uploadFileIndex].percent =
              parseInt(percent * 100) + "%";
            console.log(percent, "percent");
          }
        })
        .then(res => {
          // data.attach = 'http://dev-consult.oss-cn-hangzhou.aliyuncs.com/' + res.name
          this.uploadQuene[this.uploadFileIndex].status = "resolve";
          this.uploadQuene[
            this.uploadFileIndex
          ].file_address = res.res.requestUrls[0].split("?")[0];
          this.uploadQuene[
            this.uploadFileIndex
          ].fileAddress = res.res.requestUrls[0].split("?")[0];
          this.uploadFileIndex++;
          this.uploadFileQuene();
          console.log(res, this.uploadQuene, "111");
        });
    },
    handleFileChange (file, filelist) {
      // 简易版debounce，以最后一次为准
      clearTimeout(this.timerId);
      this.timerId = setTimeout(() => {
        // elementui 上传组件会把filelist中所有status为ready的数据上传，
        // 因此首先把所有数据的status置为waiting，然后依次把status置为ready，实现队列效果
        filelist.map(item => {
          item.file_alias = item.name;
          item.fileName = item.name;
          item.file_ext = item.name.split(".")[1];
          item.file_size = (item.size / (1024 * 1024)).toFixed(2) + "M";
          item.status = "waiting";
          this.$set(item, "percent", "0%");
        });
        this.uploadQuene = filelist;
        this.uploadFileIndex = 0;
        this.uploadQueneDialogVisible = true;
        // 控制文件一个个上传
        this.uploadFileQuene();
      }, 300);
    },
    // 通过队列的方式上传
    uploadFileQuene () {
      if (this.uploadFileIndex < this.uploadQuene.length) {
        this.uploadQuene[this.uploadFileIndex].status = "ready";
        this.$refs.uploadFile.submit();
      }
    },
    handleFileSuccess () { },
    beforeFileUpload (file) {
    },
    // 文件超出数量限制钩子函数
    handleFileExceed (file, filelist) {
      let count = file.length + this.filesList.length
      if (count > 5) {
        this.$message.warning("最多同时上传5个文件");
      }
    },
    //验收报告是否显示
    isShowTestReport () {
      let isShow = false;
      let projectStage = this.requestParams.project_stage;
      if (projectStage === "5" || projectStage === "6") {
        //完工扫尾、竣工验收
        isShow = true;
      }
      return isShow;
    },
    // 过滤掉骏工验收
    filterJunGongYanShou () {
      this.ProjecPhaseFilterArr = Object.assign([], this.ProjecPhaseArr);
      let list = this.ProjecPhaseFilterArr || [];
      if (list.length > 0) {
        list.map((ele, ind) => {
          if (ele.name === "竣工验收") {
            list.splice(ind, 1);
            console.log("删除->", ele.name);
          }
        });
      }
      this.ProjecPhaseFilterArr = list;
    },
    onButtReasonChange (val) {
      //接入原因改变时触发的事件
      // this.requestParams.not_butt_reason = val.length > 0 ? val.join(',') : '';
      // console.log('selNotButtReasonArr=', this.selNotButtReasonArr)
    },
    getIsButtArr () {//是否对接劳务实名、是否对接扬尘监控、是否对接塔机黑匣子、是否对接视频监控
      let arr = [];
      let isButtLabor = this.$route.query.is_butt_labor || 0;//是否对接劳务实名
      let isButtDust = this.$route.query.is_butt_dust || 0;//是否对接扬尘监控
      let isButtTower = this.$route.query.is_butt_tower || 0;//是否对接塔机黑匣子
      let isButtVideo = this.$route.query.is_butt_video || 0;//是否对接视频监控
      arr.push(isButtLabor, isButtTower, isButtVideo, isButtDust)
      return arr;
    },
    getSupplierAccessList (project_id) {
      //供应商接入详情
      ZHGDConsSitApi.getSupplierAccessList({
        params: {
          project_id
        }
      }).then(async res => {
        let isButtArr = await this.getIsButtArr()
        if (res.code == 0) {
          res.data.list.forEach((item, index) => {
            this.notConnectedReasonList[index].is_butt_status = isButtArr[index];// 是否对接劳务实名、是否对接扬尘监控、是否对接塔机黑匣子、是否对接视频监控           
            this.notConnectedReasonList[index].supplier_code =
              item.supplier_code;
            this.notConnectedReasonList[index].not_butt_reason =
              item.not_butt_reason;
            this.notConnectedReasonList[index].not_butt_reason_detail =
              item.not_butt_reason_detail;
            this.notConnectedReasonList[index].access_stat = item.access_stat;
            this.notConnectedReasonList[index].signAgreement =
              item.contract_stat == 0 ? false : true;
            this.notConnectedReasonList[index].isPay =
              item.payment_stat == 0 ? false : true;
            this.notConnectedReasonList[index].payment_amount =
              item.payment_amount;
          });
          this.$nextTick(() => {
            this.notConnectedReasonList = this.notConnectedReasonList;
          });
          console.log('表格数据 notConnectedReasonList=', this.notConnectedReasonList)
        }
      });
    },
    getAccessStat (supplier_type_code, index) {
      //获取供应商接入情况
      ZHGDConsSitApi.getAccessStat({
        params: {
          project_id: this.requestParams.project_id,
          supplier_type_code
        }
      }).then(res => {
        const { access_stat } = res.data;
        this.notConnectedReasonList[index].access_stat = access_stat;
      });
    },
    buttEdit () {
      //编辑
      let supplier_info = [];
      this.notConnectedReasonList.forEach(item => {
        let obj = {
          supplier_type_code: item.supplier_type_code,
          supplier_code: item.supplier_code,
          access_stat: item.access_stat,
          contract_stat: item.signAgreement ? 1 : 0,
          payment_stat: item.isPay ? 1 : 0,
          payment_amount: item.payment_amount,
          not_butt_reason: item.not_butt_reason,
          not_butt_reason_detail: item.not_butt_reason_detail
        };
        supplier_info.push(obj);
      });
      ZHGDConsSitApi.buttEdit({
        data: {
          project_id: this.requestParams.project_id,
          project_stage: this.requestParams.project_stage,
          contract_type: this.requestParams.contract_type,
          supplier_info
        }
      })
        .then(res => {
          if (res.code == 0) {
            this.$message.success("操作成功");
            this.onCancel();
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    // 未接入原因标准码
    getCodeNoToken () {
      this.notButtReasonArr = []
      standardCodeApi.getCodeNoToken({
        data: {
          code_type: 'notButtReason',
          is_page: 0,
          system_no: "industry",
          no_token: "1"
        }
      }).then((res) => {
        if (res.code === 0) {
          let list = res.data.length > 0 ? res.data[0].sub_data : []
          this.notButtReasonArr = list
        }
      }).catch((error) => {
        console.log(error)
      })
    },
    // 获取标准码
    getStandardCode (code, codeData, codeMap, codeLocal) {
      return standardCodeApi
        .getStandardCodeData({
          data: {
            code_type: code
          }
        })
        .then(
          res => {
            if (res.code === 0 && res.data.list) {
              this[codeData] = res.data.list;
              this[codeMap] = [];
              this[codeData].map(item => {
                this[codeMap].push(item);
                // this[codeMap][item.value] = item
              });
              window.localStorage.setItem(
                codeLocal,
                JSON.stringify(res.data.list)
              );
            }
          },
          err => {
            console.log(err);
          }
        );
    },
    // 初始化标准码
    async initCode (code, codeData, codeMap, codeLocal) {
      let local = window.localStorage.getItem(codeLocal);

      if (local) {
        this[codeData] = JSON.parse(local);
        this[codeMap] = [];
        this[codeData].map(item => {
          this[codeMap].push(item);
          //this[codeMap]一开始undefined,找不到item.value,会报错
          // this[codeMap][item.value] = item
        });
      } else {
        await this.getStandardCode(code, codeData, codeMap, codeLocal);
      }
    },
    onCancel () {
      //取消
      window.history.go(-1); //返回上一页
    },
    onSure (data) {
      //确定
      this.$refs[data].validate(valid => {
        if (valid) {
          this.buttEdit(); //编辑
        } else {
          console.log("error");
        }
      });
    },
    getValueSwitch (zhgdConSituatDetailObj) {
      //值转换
      if (zhgdConSituatDetailObj) {
        this.requestParams = Object.assign(
          {},
          JSON.parse(zhgdConSituatDetailObj)
        );
      } else {
        this.requestParams = Object.assign(
          {},
          this.$store.state.zhgdConSituatDetailObj
        );
      }
      this.requestParams.project_stage = String(
        this.requestParams.project_stage
      ); //进度部位-字符型
      this.requestParams.contract_type = String(
        this.requestParams.contract_type
      ); //承包类型-字符型
      this.selNotButtReasonArr = this.requestParams.not_butt_reason
        ? this.requestParams.not_butt_reason.split(",")
        : [];
    },
    getSuppliers () {
      ZHGDConsSitApi.getSuppliers().then(res => {
        if (res.code == 0) {
          this.suppliers = [];
          res.data.list.forEach(item => {
            let obj = {
              name: item.supplier_name,
              value: item.supplier_code
            };
            this.suppliers.push(obj);
          });
        }
      });
    }
  },
  async created () {
    let zhgdConSituatDetailObj = window.localStorage.getItem(
      "zhgdConSituatDetailObj"
    ); //当前的对象
    this.requestParams.project_id = this.$route.query.project_id; //项目主键值
    await this.getSupplierAccessList(this.$route.query.project_id); //供应商接入详情列表
    this.getValueSwitch(zhgdConSituatDetailObj); //值转换

    await this.getCodeNoToken() //未接入原因
    await this.initCode(
      "projectStage",
      "ProjecPhaseArr",
      "ProjecPhaseMap",
      "ProjecPhaseMap"
    ); //进度部位
    await this.initCode(
      "contractType",
      "contractTypeArr",
      "contractTypeMap",
      "contractTypeMap"
    ); //承包类型
    await this.initCode(
      "notButtReason",
      "notButtReasonArr",
      "notButtReasonMap",
      "notButtReasonMap"
    ); //未接入原因
    await this.getSuppliers(); //供应商数组
    await this.filterJunGongYanShou(); //过滤掉骏工验收
    if (this.requestParams.project_stage == 0) {
      this.requestParams.project_stage = "";
    }
    if (this.requestParams.contract_type == 0) {
      this.requestParams.contract_type = "";
    }
    await this.queryFiles()//验收报告
  }
};
</script>
<style lang="scss" scoped>
.screen-data-maintain-container {
  .condition-style {
    height: 54px;
    position: relative;
    display: flex;
    flex-direction: row;
  }

  .title {
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    color: rgba($color: #000000, $alpha: 0.85);
    line-height: 54px;
    padding-left: 20px;
    border-bottom: 1px solid #e6e6e6;
  }

  .table-sel-style {
    width: 100%;
  }

  .padding-style {
    padding-left: 20px !important;
    padding-right: 20px !important;

    .reason-style {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }

    .sel-style {
      width: 50%;
    }

    .input-style {
      width: 50%;
    }

    .pro-zhgd-situation {
      margin: 20px 0px;
    }

    .pro-progress {
      margin-top: 20px !important;
      margin-bottom: 20px !important;
    }
  }

  .bottom-style {
    text-align: center;
    margin: 20px 0px;
  }
}

/deep/ input::-webkit-outer-spin-button,
/deep/ input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
}

/deep/ input[type="number"] {
  -moz-appearance: textfield !important;
}
.tip-height {
  height: 12px;
  line-height: 12px;
}
.upload-quene-list {
  .upload-quene-item {
    width: 100%;
    height: 48px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 40px;
    font-size: 14px;
    color: #666;

    &:first-child {
      border-top: 1px solid #e5e5e5;
    }

    .file-name {
      width: 350px;
      margin-right: 80px;
      display: flex;
      align-items: center;
      img {
        width: 24px;
        height: 24px;
        margin-right: 15px;
      }
    }

    .file-size {
      width: 60px;
      margin-right: 40px;
    }

    .dir-name {
      width: 100px;
      margin-right: 40px;
      color: #1890ff;
    }

    .status {
      color: #333;
      display: flex;
      align-items: center;

      i {
        color: #52c41a;
        margin-right: 8px;
      }
    }
  }
}
.accept-position {
  margin-top: 15px;
  ul {
    li {
      color: #409eff;
      height: 30px;
      line-height: 30px;
      display: flex;
      flex-direction: row;
      margin-bottom: 12px;
      p:nth-child(1) {
        width: 60%;
        white-space: nowrap; /* 防止换行 */
        overflow: hidden; /* 隐藏超出范围的内容 */
        text-overflow: ellipsis; /* 显示省略号 */
      }
      p:nth-last-child(1) {
        width: 40%;
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
      }
    }
    li:nth-last-child(1) {
      margin-bottom: 0px !important;
    }
  }
}
</style>
